/**
Copyright 2010, David Keyes.  All rights reserved.

Licensed under the Apache License, Version 2.0 (the "License"); you may 
not use this file except in compliance with the License. You may obtain
a copy of the License at

  http://www.apache.org/licenses/LICENSE-2.0 

Unless required by applicable law or agreed to in writing, software 
distributed under the License is distributed on an "AS IS" BASIS, 
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and 
limitations under the License. 

*/
package com.keyes.license.api.model;

import java.util.SortedMap;
import java.util.TreeMap;

import com.keyes.protobuf.CodedInputStream;

public class RequestContext extends ProtoBufBase {

  public RequestContext() {
    super();
  }

  public RequestContext(CodedInputStream pCis) {
    super(pCis);
  }

  @Override
  public SortedMap<Integer, ProtoBufMapping> calculateMappings() {
    SortedMap<Integer, ProtoBufMapping> lRet = new TreeMap<Integer, ProtoBufMapping>();
    
    lRet.put(1, new ProtoBufMapping(1, "authSubToken", PROTOBUFTYPE.LENGTHDELIM_STRING, true));
    lRet.put(2, new ProtoBufMapping(2, "unknown1",  PROTOBUFTYPE.VARINT, new Integer(0), true));
    lRet.put(3, new ProtoBufMapping(3, "version",  PROTOBUFTYPE.VARINT, new Integer(1002), true));
    lRet.put(4, new ProtoBufMapping(4, "androidId", PROTOBUFTYPE.LENGTHDELIM_STRING, true));

    lRet.put(5, new ProtoBufMapping(5, "deviceAndSdkVersion", PROTOBUFTYPE.LENGTHDELIM_STRING, false));
    lRet.put(6, new ProtoBufMapping(6, "userLanguage", PROTOBUFTYPE.LENGTHDELIM_STRING, false));
    lRet.put(7, new ProtoBufMapping(7, "userCountry", PROTOBUFTYPE.LENGTHDELIM_STRING, false));
    lRet.put(8, new ProtoBufMapping(8, "operatorAlpha", PROTOBUFTYPE.LENGTHDELIM_STRING, false));
    lRet.put(9, new ProtoBufMapping(9, "simOperatorAlpha", PROTOBUFTYPE.LENGTHDELIM_STRING, false));
    lRet.put(10, new ProtoBufMapping(10, "operatorNumeric", PROTOBUFTYPE.LENGTHDELIM_STRING, false));
    lRet.put(11, new ProtoBufMapping(11, "simOperatorNumeric", PROTOBUFTYPE.LENGTHDELIM_STRING, false));

    
    return lRet;
  }

  public void setAuthSubToken(String pStr){
    storeValue(1, pStr);
  }
  
  public String getAuthSubToken(){
    return (String) mIdMappedValues.get(1);
  }
  
  public void setUnknown1(int pValue){
    storeValue(2, 0);
  }
  public void setVersion(int pValue){
    storeValue(3, 1002);
  }
  
  public void setAndroidId(String pId){
    storeValue(4, pId);
  }
  public void setDeviceAndSdkVersion(String pVersion){
    storeValue(5, pVersion);
  }
  
  public void setUserLanguage(String pLang){
    storeValue(6, pLang);
  }
  
  public void setUserCountry(String pCountry){
    storeValue(7, pCountry);
  }
  
  public void setOperatorAlpha(String pOpAlpha){
    storeValue(8, pOpAlpha);
  }
  
  public void setSimOperatorAlpha(String pSimOpAlpha){
    storeValue(9, pSimOpAlpha);
  }
  
  public void setOperatorNumeric(String pOpNum){
    storeValue(10, pOpNum);
  }
  
  public void setSimOperatorNumeric(String pSimOpNum){
    storeValue(11, pSimOpNum);
  }
}
